package com.muyu.system.service.impl;


import com.muyu.common.core.utils.DateUtils;
import com.muyu.system.domain.DanmoShoppingProductsPicture;
import com.muyu.system.mapper.DanmoShoppingProductsPictureMapper;
import com.muyu.system.service.IDanmoShoppingProductsPictureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 商品图片Service业务层处理
 *
 * @author yangle
 * @date 2024-09-29
 */
@Service
public class DanmoShoppingProductsPictureServiceImpl implements IDanmoShoppingProductsPictureService
{
    @Autowired
    private DanmoShoppingProductsPictureMapper danmoShoppingProductsPictureMapper;

    /**
     * 查询商品图片
     *
     * @param id 商品图片主键
     * @return 商品图片
     */
    @Override
    public DanmoShoppingProductsPicture selectDanmoShoppingProductsPictureById(Long id)
    {
        return danmoShoppingProductsPictureMapper.selectDanmoShoppingProductsPictureById(id);
    }

    /**
     * 查询商品图片列表
     *
     * @param danmoShoppingProductsPicture 商品图片
     * @return 商品图片
     */
    @Override
    public List<DanmoShoppingProductsPicture> selectDanmoShoppingProductsPictureList(DanmoShoppingProductsPicture danmoShoppingProductsPicture)
    {
        return danmoShoppingProductsPictureMapper.selectDanmoShoppingProductsPictureList(danmoShoppingProductsPicture);
    }

    /**
     * 新增商品图片
     *
     * @param danmoShoppingProductsPicture 商品图片
     * @return 结果
     */
    @Override
    public int insertDanmoShoppingProductsPicture(DanmoShoppingProductsPicture danmoShoppingProductsPicture)
    {
        danmoShoppingProductsPicture.setCreateTime(DateUtils.getNowDate());
        return danmoShoppingProductsPictureMapper.insertDanmoShoppingProductsPicture(danmoShoppingProductsPicture);
    }

    /**
     * 修改商品图片
     *
     * @param danmoShoppingProductsPicture 商品图片
     * @return 结果
     */
    @Override
    public int updateDanmoShoppingProductsPicture(DanmoShoppingProductsPicture danmoShoppingProductsPicture)
    {
        danmoShoppingProductsPicture.setUpdateTime(DateUtils.getNowDate());
        return danmoShoppingProductsPictureMapper.updateDanmoShoppingProductsPicture(danmoShoppingProductsPicture);
    }

    /**
     * 批量删除商品图片
     *
     * @param ids 需要删除的商品图片主键
     * @return 结果
     */
    @Override
    public int deleteDanmoShoppingProductsPictureByIds(Long[] ids)
    {
        return danmoShoppingProductsPictureMapper.deleteDanmoShoppingProductsPictureByIds(ids);
    }

    /**
     * 删除商品图片信息
     *
     * @param id 商品图片主键
     * @return 结果
     */
    @Override
    public int deleteDanmoShoppingProductsPictureById(Long id)
    {
        return danmoShoppingProductsPictureMapper.deleteDanmoShoppingProductsPictureById(id);
    }
}
